#pragma once

#include <map>
#include <functional>
#include <vector>
#include <atomic>

class Radar;

class RadarConverter
{
    typedef std::function<void(void *)> converter_callback;

public:
    RadarConverter();
    virtual ~RadarConverter();

    virtual void radar_video_process(unsigned int bearing, uint8_t *data, unsigned int length) = 0;
    void add_converter_callback(converter_callback cb);

    void set_radar(Radar *radar) { radar_ = radar; }
protected:
    void start_callback(void *data);

protected:
    std::vector<converter_callback> converter_cbs_;

    std::atomic<bool> is_converting_;

    unsigned int radar_spoke_index_;
    Radar *radar_;
};